package helper;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public abstract class Calendr {
    
    public static DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
    
    //get todays date in correct format
    public static Date getTodaysDate(){
        
        Date d = new Date();
        d.getTime();
        
        return d;
        
    }
    
    public static String getTodayDateString(){
        Date d = Calendr.getTodaysDate();
        String reportDate = df.format(d);   
        return reportDate;
    }
    
    //Alvin
    public static Calendar getTodayDateCalendar(){
	    Calendar cal = Calendar.getInstance();
	    /*
	    int day = cal.get(Calendar.DATE);
	    int month = cal.get(Calendar.MONTH) + 1;
	    int year = cal.get(Calendar.YEAR);
	    int dow = cal.get(Calendar.DAY_OF_WEEK);
	    int dom = cal.get(Calendar.DAY_OF_MONTH);
	    int doy = cal.get(Calendar.DAY_OF_YEAR);
	    */
	    return cal;
	}
        
    public static Date parseTimestamp(String timestampDDMMYYYY) throws Exception {

        //java.sql.Date cal = null;
        Date date = df.parse(timestampDDMMYYYY);
        
        return date;
    }

}
